package com.xyy.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDateTime;

/**
 * 用户反馈实体类
 */
@TableName("feedback")
public class Feedback {
    
    @TableId(type = IdType.AUTO)
    private Long id;
    
    /**
     * 用户ID
     */
    private Long userId;
    
    /**
     * 管理员ID（可为空，表示系统反馈）
     */
    private Long adminId;
    
    /**
     * 管理员真实姓名（冗余字段，便于查询）
     */
    private String adminRealName;
    
    /**
     * 反馈内容
     */
    private String content;
    
    /**
     * 反馈图片，多个图片用逗号分隔
     */
    private String images;
    
    /**
     * 处理状态：PENDING-待处理，PROCESSING-处理中，RESOLVED-已解决，REJECTED-已拒绝
     */
    private String status;
    
    /**
     * 管理员回复内容
     */
    private String adminReply;
    
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;
    
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;
    
    // 构造函数
    public Feedback() {}
    
    public Feedback(Long userId, Long adminId, String adminRealName, String content, String images) {
        this.userId = userId;
        this.adminId = adminId;
        this.adminRealName = adminRealName;
        this.content = content;
        this.images = images;
        this.status = "PENDING";
    }
    
    // Getter和Setter方法
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getUserId() {
        return userId;
    }
    
    public void setUserId(Long userId) {
        this.userId = userId;
    }
    
    public Long getAdminId() {
        return adminId;
    }
    
    public void setAdminId(Long adminId) {
        this.adminId = adminId;
    }
    
    public String getAdminRealName() {
        return adminRealName;
    }
    
    public void setAdminRealName(String adminRealName) {
        this.adminRealName = adminRealName;
    }
    
    public String getContent() {
        return content;
    }
    
    public void setContent(String content) {
        this.content = content;
    }
    
    public String getImages() {
        return images;
    }
    
    public void setImages(String images) {
        this.images = images;
    }
    
    public String getStatus() {
        return status;
    }
    
    public void setStatus(String status) {
        this.status = status;
    }
    
    public String getAdminReply() {
        return adminReply;
    }
    
    public void setAdminReply(String adminReply) {
        this.adminReply = adminReply;
    }
    
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }
    
    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }
    
    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }
    
    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }
    
    @Override
    public String toString() {
        return "Feedback{" +
                "id=" + id +
                ", userId=" + userId +
                ", adminId=" + adminId +
                ", adminRealName='" + adminRealName + '\'' +
                ", content='" + content + '\'' +
                ", images='" + images + '\'' +
                ", status='" + status + '\'' +
                ", adminReply='" + adminReply + '\'' +
                ", createdAt=" + createdAt +
                ", updatedAt=" + updatedAt +
                '}';
    }
}


